﻿using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;

namespace UPos.Core
{
    public class PaymentType
    {
        public string Code { get; private set; }

        private string _id;
        public string ID
        {
            get
            {
                return _id;
            }
            set
            {
                _id = value;
                SetCode();
            }
        }

        public string Name { get; set; }

        public PaymentType(string id, string name)
        {
            ID = id;
            Name = name;
        }

        private void SetCode()
        {
            switch (ID)
            {
                case "001": Code = "CH"; break; //现金
                case "003": Code = "CI"; break;	//银联
                default: Code = "OT"; break;
            }
        }
    }
}

